#pragma once

#include "resource.h"
#include "MainView.h"
#include <commctrl.h>
#include <memory>

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

class CRibbonExplorer
{
	friend LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

private:
	const HINSTANCE m_hInstance;
	const LPTSTR m_lpCmdLine;
	const int m_nCmdShow;
	TCHAR m_szTitle[MAX_LOADSTRING];					// The title bar text
	TCHAR m_szWindowClass[MAX_LOADSTRING];			// the main window class name
	static CRibbonExplorer *s_pTheRibbonExplorer;
	HWND m_hWnd;
	CMainView *m_pMainView;
	

	ATOM MyRegisterClass();
	BOOL InitInstance();
	void ResizeChildWindows(RECT parentRect);
	void Exit();


	LRESULT ProcessMessege(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

public:
	CRibbonExplorer(HINSTANCE hInstance, LPTSTR lpCmdLine, int nCmdShow) :
	  m_hInstance(hInstance), m_lpCmdLine(lpCmdLine), m_nCmdShow(nCmdShow) 
	  {
		if (s_pTheRibbonExplorer != 0)
			throw L"Only one instance of CRibbonExplorer is allowed";
		s_pTheRibbonExplorer = this;
	  }

	int Run();
};